package com.ruoyi.slope.warning.pushRecord.service.impl;

import java.util.List;

import com.ruoyi.common.annotation.DataScope;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.slope.warning.pushRecord.mapper.SlopeWarningPushrecordMapper;
import com.ruoyi.slope.warning.pushRecord.domain.SlopeWarningPushrecord;
import com.ruoyi.slope.warning.pushRecord.service.ISlopeWarningPushrecordService;

/**
 * 推送记录Service业务层处理
 * 
 * @author psy
 * @date 2025-04-27
 */
@Service
public class SlopeWarningPushrecordServiceImpl implements ISlopeWarningPushrecordService 
{
    @Autowired
    private SlopeWarningPushrecordMapper slopeWarningPushrecordMapper;

    /**
     * 查询推送记录
     * 
     * @param id 推送记录主键
     * @return 推送记录
     */
    @Override
    public SlopeWarningPushrecord selectSlopeWarningPushrecordById(Long id)
    {
        return slopeWarningPushrecordMapper.selectSlopeWarningPushrecordById(id);
    }

    /**
     * 查询推送记录列表
     * 
     * @param slopeWarningPushrecord 推送记录
     * @return 推送记录
     */
    @DataScope(deptAlias = "s")
    @Override
    public List<SlopeWarningPushrecord> selectSlopeWarningPushrecordList(SlopeWarningPushrecord slopeWarningPushrecord)
    {
        return slopeWarningPushrecordMapper.selectSlopeWarningPushrecordList(slopeWarningPushrecord);
    }

    /**
     * 新增推送记录
     * 
     * @param slopeWarningPushrecord 推送记录
     * @return 结果
     */
    @Override
    public int insertSlopeWarningPushrecord(SlopeWarningPushrecord slopeWarningPushrecord)
    {
        slopeWarningPushrecord.setCreateTime(DateUtils.getNowDate());
        return slopeWarningPushrecordMapper.insertSlopeWarningPushrecord(slopeWarningPushrecord);
    }

    /**
     * 修改推送记录
     * 
     * @param slopeWarningPushrecord 推送记录
     * @return 结果
     */
    @Override
    public int updateSlopeWarningPushrecord(SlopeWarningPushrecord slopeWarningPushrecord)
    {
        slopeWarningPushrecord.setUpdateTime(DateUtils.getNowDate());
        return slopeWarningPushrecordMapper.updateSlopeWarningPushrecord(slopeWarningPushrecord);
    }

    /**
     * 批量删除推送记录
     * 
     * @param ids 需要删除的推送记录主键
     * @return 结果
     */
    @Override
    public int deleteSlopeWarningPushrecordByIds(Long[] ids)
    {
        return slopeWarningPushrecordMapper.deleteSlopeWarningPushrecordByIds(ids);
    }

    /**
     * 删除推送记录信息
     * 
     * @param id 推送记录主键
     * @return 结果
     */
    @Override
    public int deleteSlopeWarningPushrecordById(Long id)
    {
        return slopeWarningPushrecordMapper.deleteSlopeWarningPushrecordById(id);
    }
}
